home *** CD-ROM | disk | FTP | other *** search
- #include "FlightRecorder.h"
-
- void StartRecording(storage *s)
- {
-
- FSSpec file;
- OSErr err;
- short saveResFile;
-
- s = GetStoragePtr();
- s->fCount = 128;
-
-
- /* create a file spec for the PICS file */
- /* this puts it in the default directory, at least for me */
- /* I tried to use StandardFile, but Ley does not process update events */
- /* while playing a reply, and it trashed the animation */
- /* I could have made this save and restore the bits */
- /* but this works and after all, it is a hack */
- err = FSMakeFSSpec(0, 0, "\pInstant Reply",&file);
-
- /* delete the one that was there */
- /* if you liked it tooo bad!@ */
- (void)FSpDelete(&file);
-
- /* save the application's resource chain because we */
- /* are about to open another file on it and do not want to */
- /* screw the app up */
- saveResFile = CurResFile();
-
- /* create the PICS file */
- FSpCreateResFile(&file, '????','PICS', -1); // smSystemScript
- if( err = ResError() ) {
- DebugStr("\p FSpCreateResFile failed");
- }
-
- /* and open it up */
- s->ref = FSpOpenResFile(&file, fsRdWrPerm);
- if(err = ResError() ) {
- DebugStr("\p FSpOpen failed");
- }
-
- /* put the chain back the way it was because */
- /* saveAFrame also saves it */
- UseResFile(saveResFile);
-
- /* take the first picture of the movie */
- SaveAFrame(s);
- }
-